package com.ggqq.adapter;
//客户类：想上网，插不上网线
public class Computer {
    public void net(NetToUsb adpater){
        //上网的具体实现 找一个转接头
        adpater.handleRequest();
    }

    public static void main(String[] args) {
        //电脑，适配器，网线
        Computer computer = new Computer();//电脑

        Adaptee adaptee = new Adaptee();//网线
/*        Adapter adapter = new Adapter();//适配器
        computer.net(adapter);//第一种方式*/

        Adapter2 adapter2 = new Adapter2(adaptee);//第二种方式
        computer.net(adapter2);



    }

}
